﻿using System.IO;

namespace Rosetta.Default.AddIns.IO
{
    public sealed class DirectoryInputter : Inputter
    {
        #region Fields

        private DirectoryInfo value;

        #endregion

        #region Constructors

        public DirectoryInputter()
            : base("Directory Inputter")
        {
            Category = "IO";
            ContextType = typeof(DirectoryInfo);

            Add<DirectoryInfo>("GetDirectory", GetDirectory);
        }

        #endregion

        #region Public Methods

        public override void UseContext(object context)
        {
            value = context as DirectoryInfo;
        }

        #endregion

        #region Private Methods

        private DirectoryInfo GetDirectory()
        {
            return value;
        }

        #endregion
    }
}